home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-07-19 | 1.4 KB | 66 lines | [TEXT/MMCC] |
- /************************************************************
- *
- * Created: Tuesday, March 29, 1994 2:55:51 PM
- * CFiller.cp
- * Implementation of a dummy persistent object class
- *
- *
- * Copyright © Neologic Systems 1992-1994. All Rights Reserved.
- * All rights reserved
- *
- ***********************************************************/
-
- #include "NeoTypes.h"
- #include CNeoStreamH
- #include "CFiller.h"
-
- long CFiller::FFileLength = sizeof(CFiller);
- static char GBuffer[kFillerMaxLength];
-
- CNeoPersist *CFiller::New(void)
- {
- return new CFiller;
- }
-
- NeoID CFiller::getClassID(void) const
- {
- return kFillerID;
- }
-
- long CFiller::getFileLength(void) const
- {
- return FFileLength;
- }
-
- #pragma segment NeoRead
- void CFiller::readObject(CNeoStream *aStream, const NeoTag aTag)
- {
- inherited::readObject(aStream, aTag);
-
- if (FFileLength - sizeof(CFiller) > 0)
- aStream->readChunk(GBuffer, FFileLength - sizeof(CFiller));
- }
-
- #pragma segment NeoWrite
- void CFiller::writeObject(CNeoStream *aStream, const NeoTag aTag)
- {
- inherited::writeObject(aStream, aTag);
-
- if (FFileLength - sizeof(CFiller) > 0)
- aStream->writeChunk(GBuffer, FFileLength - sizeof(CFiller));
- }
-
- /** Variable Length Methods **/
- long CFiller::SetLength(const long aLength)
- {
- if (aLength < sizeof(CFiller))
- FFileLength = sizeof(CFiller);
- else if (aLength > kFillerMaxLength)
- FFileLength = kFillerMaxLength;
- else
- FFileLength = aLength;
-
- return FFileLength;
- }
-
-